﻿<!DOCTYPE html>
<html>

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
	<meta http-equiv="refresh" content="50;url='https://github.com/iGaoWei/BigDataView'">
	<title>看板登录</title>
	<link rel="stylesheet" type="text/css" href="css/reset.css" />
	<link rel="stylesheet" type="text/css" href="css/scanboardLogin.css" />
	<link rel="stylesheet" type="text/css" href="css/animsition.css" />
	<script src="http://cdn.bootcss.com/blueimp-md5/1.1.0/js/md5.js"></script>
	<script src="https://cdn.bootcdn.net/ajax/libs/js-cookie/3.0.1/js.cookie.js"></script>
</head>

<body>
	<div class="wp animsition">
		<div class="boardLogin">
			<a href="javascript:void(0);" class="logo">
				<!-- <img src="images/loginLogo.png"> -->
				<div style="font-size: 30px;color: aqua;">智慧可视化平台</div>
			</a>
			<form>
				<div class="inpGroup">
					<span class="loginIco1"></span>
					<input type="text" id="username" name="" value="admin" placeholder="请输入您的用户名">
				</div>
				<div class="prompt">
					<p class="error">用户名错误或不存在</p>
				</div>

				<div class="inpGroup">
					<span class="loginIco2"></span>
					<input type="password" id="password" name="" value="sunhuijun2" placeholder="请输入您的密码">
				</div>
				<div class="prompt">
					<p class="success">输入正确</p>
				</div>

				<!-- <button class="submit">登录</button> -->
				<a href="javascript:void(0);" class="animsition-link submit" onclick="onLogin()">登录</a>
			</form>
		</div>
	</div>
	<div id="particles-js"></div>
</body>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.animsition.js"></script>
<script src="js/particles.min.js"></script>
<script src="js/app.js"></script>
<script type="text/javascript">
	$(".animsition").animsition({
		inClass: 'fade-in',
		outClass: 'fade-out',
		inDuration: 800,
		outDuration: 1000,
		linkElement: '',

		loading: false,
		loadingParentElement: 'body',
		loadingClass: 'animsition-loading',
		unSupportCss: ['animation-duration',
			'-webkit-animation-duration',
			'-o-animation-duration'
		],


		overlay: false,

		overlayClass: 'animsition-overlay-slide',
		overlayParentElement: 'body'
	});
</script>
<script>
	function onLogin() {
		var data = {
			username: $("#username").val(),
			password: md5($("#password").val()),
		}
		$.ajax("http://192.168.8.17/api/v1/login", {
			method: 'POST',
			data: JSON.stringify(data),
			crossDomain: true, //设置跨域为true
			xhrFields: {
				withCredentials: true
			},
			headers: {
				"content-type": "application/json",
			},

			success: function (result) {
				
				if (result.Token) {
					localStorage.setItem("token", result.Token);
					window.location.href = "index.html";
				}
			},
			error: function (err) {
				console.log(err);
			}
		})
	}
</script>

</html>